package me.send.business.service.service;

import me.send.business.base.ErrorEntity;
import me.send.business.service.BaseService;
import me.send.business.service.mapper.FeedbackMapper;
import me.send.business.service.pojo.Feedback;
import me.send.framework.util.HelperUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeedbackService extends BaseService {

	@Autowired
	private FeedbackMapper feedbackMapper;

	public ErrorEntity save(Feedback feedback, String devicenumber) {
		if (isDevicenumber(devicenumber)) {
			// 判断对象 和 保存对象
			if (feedback!=null) {	
				feedback.setCreatetime(HelperUtil.getCurrentDate());
				// 调用保存方法
				feedbackMapper.save(feedback);
				return error_1000();
			}else {
				return error_1001();
			}
		}
		else{
			return error_1002();
		}
	}

}
